package com.wits.qso.dao.impl;

import java.util.List;

import javax.persistence.Query;

import org.springframework.stereotype.Component;

import com.wits.platform.dao.impl.BaseDaoImpl;
import com.wits.qso.dao.custom.GradeDaoCustom;
import com.wits.qso.entity.Grade;

@Component
public class GradeDaoImpl extends BaseDaoImpl<Grade, String> implements GradeDaoCustom{

	@Override
	public boolean isExitGradebyTitle(String title) {
		Query query=em.createQuery("FROM Grade o WHERE o.gradeTitle = :gradeTitle");
		query.setParameter( "gradeTitle", title );
		List list=query.getResultList();
		if(list!=null && list.size()>0) 
			return true;
		else
			return false;
	}

}
